package com.cx.cxapi;

import android.app.Activity;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.jws.thirdlibrary.CxManager;

public class DevicesActivity extends Activity {

	private TextView model,Android_version,running,inner,device_sn,firware,kernel,version;
	private CxManager mCxManager = null;
	
	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		setContentView(R.layout.devices);

		model = (TextView)findViewById(R.id.model);
		Android_version = (TextView)findViewById(R.id.Android_version);
		running = (TextView)findViewById(R.id.running);
		inner = (TextView)findViewById(R.id.inner);
		device_sn = (TextView)findViewById(R.id.device_sn);
		firware = (TextView)findViewById(R.id.firware);
		kernel = (TextView)findViewById(R.id.kernel);
		version = (TextView)findViewById(R.id.version);
	}

	@Override
	protected void onResume() {
		super.onResume();
		mCxManager = CxManager.create(this);

		String AndroidModel=getString(R.string.jws_AndroidModel)+"\n"+mCxManager.jwsGetAndroidModel();
		String AndroidVersion=getString(R.string.jws_AndroidVersion)+"\n"+mCxManager.jwsGetAndroidVersion();
		String RunningMemory=getString(R.string.jws_RunningMemory)+"\n"+mCxManager.jwsGetRunningMemory();
		String InternalStorageMemory=getString(R.string.jws_InternalStorageMemory)+"\n"+mCxManager.jwsGetInternalStorageMemory();
		String deviceSN = getString(R.string.serial_number)+"\n"+mCxManager.jwsGetDeviceSN();
		String FirmwareVersion=getString(R.string.jws_FirmwareVersion)+"\n"+mCxManager.jwsGetFirmwareVersion();
		String KernelVersion=getString(R.string.jws_KernelVersion)+"\n"+mCxManager.jwsGetFormattedKernelVersion();
		String AndroidDisplay=getString(R.string.jws_AndroidDisplay)+"\n"+mCxManager.jwsGetAndroidDisplay();

		model.setText(AndroidModel);
		Android_version.setText(AndroidVersion);
		running.setText(RunningMemory);
		inner.setText(InternalStorageMemory);
		device_sn.setText(deviceSN);
		firware.setText(FirmwareVersion);
		kernel.setText(KernelVersion);
		version.setText(AndroidDisplay);
		Log.i("deviceSN", "deviceSN = " + mCxManager.jwsGetDeviceSN());
	}

}
